SUBROUTINE MAPA
*Create a form that contains an image button showing a map of the British Isles*When the form is submitted, display different lists according to where*in the image was clicked* Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Get the URL of the Reality item server
IMAGE = ""
CALL RW_GET_PARAM("__isurl", IMAGE)* Specify the location of the image
IMAGE = IMAGE : "/REALWEB-ITEMS/map.gif"
* Start the HTML pageCALL RW_START_HTML_PAGE("Event Information", "", "", "", "")* Start the HTML form, specifying that the subroutine MAP2* should be run when the form is submittedCALL RW_START_HTML_FORM("MAP2", "MAPFORM", "")
BUF="Click on the relevant part of the map to display details of events scheduled in that area"
CALL RWA_NEWLINES(BUF, 2)*Create the image buttonCALL RWA_IMAGE_BUTTON(BUF, "MAP", "Map of British Isles", IMAGE, "")*Display the formCALL RW_PUT(BUF)*Complete the formCALL RW_END_FORM* Complete the pageCALL RW_END_PAGE
RETURN
SUBROUTINE MAP2
* Display relevant list of events for map location clicked* Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Start the HTML pageCALL RW_START_HTML_PAGE("Scheduled Events", "", "", "", "")
EQU AM TO CHAR(254)
EQU VM TO CHAR(253)
* Make the event lists
VALUE_LIST1="Photographing Sea Eagles, Strathclyde University, Nov 30th 2002":AM:...
"Winter Fun Day, Loch Insh Wood, Dec 15th 2002":AM:...
"Orkney Bird Race, around Orkney, Jan 19th 2003"
CALL RWA_MAKE_ULIST(LIST1, VALUE_LIST1, "")
VALUE_LIST2="Feeding and Watching Garden Birds, Sandy, Oct 31st 2002":AM:...
"Wildfowl Safari, Ouse Washes Nature Reserve, Nov 24th 2002"
CALL RWA_MAKE_ULIST(LIST2, VALUE_LIST2, "")
VALUE_LIST3="Cruise to Isles of Scilly, Oct 20th 2002":AM:...
"Bunting Search, Prawle Point, Oct 25th 2002":AM:...
"Owl Prowl, Totnes, Nov 2nd 2002":AM:...
"Digital Photography Workshop, The Eden Project, Jan 10th 2003"
CALL RWA_MAKE_ULIST(LIST3, VALUE_LIST3, "")*Get the coordinates of the clickCALL RW_GET_PARAM("MAP.x", X)CALL RW_GET_PARAM("MAP.y", Y)*Display event list for selected area
IF X >109 AND X <219 AND Y >13 AND Y <130 THEN
CALL RW_PUT("Events in Scotland")CALL RW_NEWLINES(3)CALL RW_PUT(LIST1)
END ELSE
IF X >211 AND X <275 AND Y >204 AND Y <254 THEN
CALL RW_PUT("Events in Eastern Region")CALL RW_NEWLINES(3)CALL RW_PUT(LIST2)
END ELSE
IF X >116 AND X <202 AND Y <331 AND Y >277 THEN
CALL RW_PUT("Events in the South West")CALL RW_NEWLINES(3)CALL RW_PUT(LIST3)
END ELSE
CALL RW_PUT("There are no events scheduled in that area")
END
END
END
* Complete the pageCALL RW_END_PAGE
RETURN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Event Information</TITLE></HEAD><BODY><FORM ACTION="MAP2" NAME="MAPFORM" METHOD="POST">
Click on the relevant part of the map to display details of events scheduled in that area<BR><BR><INPUT TYPE="IMAGE" NAME="MAP" ALT="Map of British Isles" SRC="/servlet/realityis/test/REALWEB-ITEMS/map.gif"></FORM></BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Scheduled Events</TITLE></HEAD><BODY>
Events in the South West
<BR><BR><BR><UL><LI>Cruise to Isles of Scilly, Oct 20th 2002
<LI>Bunting Search, Prawle Point, Oct 25th 2002
<LI>Owl Prowl, Totnes, Nov 2nd 2002
<LI>Digital Photography Workshop, The Eden Project, Jan 10th 2003
</UL></BODY></HTML>